package com.tarena.all;
import java.util.Scanner;

public class BuyDemo {

	/**
	 * @param 第二杯半价
	 */
	public static void main(String[] args) {
		int p=5;
		double g;
		Scanner sc=new Scanner(System.in);
		System.out.println("每杯"+p+"元，第二杯半价，选购多少杯？");
		double a=sc.nextInt();
		if(a<=0){
			System.out.println("不卖！！！");
		}else if(a==1){
			System.out.println("应付总价："+p+"元");
		}else if(a==2){
			System.out.println("应付总价："+1.5*p+"元");
		}else if(a%2==0){
			g=3*a/4;
			System.out.println("应付总价："+g*p+"元");
		}else{
			g=3*(a-1)/4+1;
			System.out.println("应付总价："+g*p+"元");
		}
	}

}
